﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kooboo.Globalization;
using System.Web.Mvc;

namespace Kooboo.Web.Areas.Commerce
{
    public class CurrencyHelper
    {
        public static IEnumerable<SelectListItem> BuildCurrencies(string selectedCurrencyCode)
        {
            foreach (var i in CurrencyInfo.GetCurrencies().OrderBy(c => c.ISOSymbol))
            {
                yield return new SelectListItem { Text = i.ISOSymbol, Value = i.ISOSymbol, Selected = i.ISOSymbol == selectedCurrencyCode };
            }
        }

    }
}